home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / DESK / CORE / Desk / h / Filing < prev    next >
Text File  |  1996-06-26  |  4KB  |  116 lines

  1.  
  2. #ifndef __Desk_Filing_h
  3. #define __Desk_Filing_h
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #ifndef __Desk_Core_h
  8. #include "Desk.Core.h"
  9. #endif
  10. #ifndef Desk_filing_MAXLEAFNAMELEN
  11. #define Desk_filing_MAXLEAFNAMELEN 32
  12. #endif
  13. typedef enum {
  14. Desk_filing_NOTFOUND = 0,
  15. Desk_filing_FILE = 1,
  16. Desk_filing_DIRECTORY = 2,
  17. Desk_filing_IMAGEFILE = 3
  18. } Desk_filing_objtype;
  19. typedef struct {
  20. int loadaddr;
  21. int execaddr;
  22. int length;
  23. int attrib;
  24. Desk_filing_objtype objtype;
  25. char name[ Desk_filing_MAXLEAFNAMELEN];
  26. } Desk_filing_direntry;
  27. typedef struct {
  28. int loadaddr;
  29. int execaddr;
  30. int length;
  31. int attrib;
  32. Desk_filing_objtype objtype;
  33. int SIN;
  34. char date[ 5];
  35. char name[ Desk_filing_MAXLEAFNAMELEN];
  36. } Desk_filing_fulldirentry;
  37. typedef enum {
  38. Desk_readdirtype_DIRENTRY,
  39. Desk_readdirtype_FULLDIRENTRY,
  40. Desk_readdirtype_NAMEONLY
  41. } Desk_filing_readdirtype;
  42. typedef struct {
  43. char *dirname;
  44. void *buf;
  45. int size;
  46. Desk_filing_readdirtype type;
  47. union {
  48. Desk_filing_direntry *direntry;
  49. Desk_filing_fulldirentry *fulldirentry;
  50. char *name;
  51. void *act;
  52. } act;
  53. int offset;
  54. int read;
  55. char *match;
  56. } Desk_filing_dirdata;
  57. void Desk_Filing_OpenDir(const char *dirname, Desk_filing_dirdata *dirdata,
  58. int bufsize, Desk_filing_readdirtype type);
  59. void *Desk_Filing_ReadDir(Desk_filing_dirdata *dirdata);
  60. Desk_bool Desk_Filing_CloseDir(Desk_filing_dirdata *dirdata);
  61. void Desk_Filing_ReadDirNames(const char *dirname, char *buf,
  62. int *number, int *offset,
  63. int size, const char *match);
  64. void Desk_Filing_ReadDirEntry(const char *dirname, Desk_filing_direntry *buf,
  65. int *number, int *offset,
  66. int size, const char *match);
  67. void Desk_Filing_ReadFullDirEntry(const char *dirname, Desk_filing_fulldirentry *buf,
  68. int *number, int *offset,
  69. int size, const char *match);
  70. void Desk_Filing_ReadCatalogue(const char *filename, Desk_filing_objtype *objtype,
  71. int *loadaddr, int *execaddr, int *length,
  72. int *attrib, int *filetype);
  73. void Desk_Filing_SingleDirEntry(const char *filename,
  74. Desk_filing_direntry *buf, int size);
  75. void Desk_Filing_SingleDirEntry2(const char *dirname,
  76. Desk_filing_direntry *buf,
  77. int size, const char *filename);
  78. void Desk_Filing_SingleFullDirEntry(const char *filename,
  79. Desk_filing_fulldirentry *buf, int size);
  80. void Desk_Filing_SingleFullDirEntry2(const char *dirname,
  81. Desk_filing_fulldirentry *buf,
  82. int size, const char *filename);
  83. char *Desk_Filing_GetPathname(const char *filename, char *pathname);
  84. char *Desk_Filing_GetLeafname(const char *filename, char *leafname);
  85. char *Desk_Filing_FindLeafname(const char *filename);
  86. char *Desk_Filing_MakePath(char *newpath, const char *dirname, const char *leafname);
  87. void Desk_Filing_CanonicalisePath(const char *pathname, char *buffer,
  88. int size, int *spare);
  89. typedef Desk_os_error *(*Desk_filing_scan_startdirfn) (const char *dirname,
  90. Desk_filing_fulldirentry *dirdata,
  91. void *reference);
  92. typedef Desk_os_error *(*Desk_filing_scan_foundfilefn) (const char *dirname,
  93. Desk_filing_fulldirentry *filedata,
  94. void *reference);
  95. typedef Desk_os_error *(*Desk_filing_scan_enddirfn) (const char *dirname,
  96. Desk_filing_fulldirentry *dirdata, 
  97. void *reference);
  98. #define Desk_filing_scan_PRUNE ((Desk_os_error *) 1)
  99. void Desk_Filing_ScanDir(const char *dirname,
  100. Desk_filing_scan_startdirfn startdirproc,
  101. Desk_filing_scan_foundfilefn foundfileproc,
  102. Desk_filing_scan_enddirfn enddirproc,
  103. void *reference
  104. );
  105. void Desk_Filing_ScanDirByDir(const char *dirname,
  106. Desk_filing_scan_startdirfn startdirproc,
  107. Desk_filing_scan_foundfilefn foundfileproc,
  108. Desk_filing_scan_enddirfn enddirproc,
  109. void *reference
  110. );
  111. int Desk_Filing_CompareDates(char date1[5], char date2[5]);
  112. #ifdef __cplusplus
  113. }
  114. #endif
  115. #endif
  116.